(1) Field of the Invention
The present invention relates to an image coding method of coding an image with prediction, and an image decoding method of decoding an image with prediction.
(2) Description of the Related Art
An image coding apparatus generally compresses an information amount using redundancy of images (including still images and moving images) in spatial and temporal directions. Here, transformation into a frequency domain is used as the compression method using redundancy in the spatial direction. Furthermore, inter prediction is used as the compression method using redundancy in the temporal direction. The inter prediction is also called inter-picture prediction.
When coding a certain picture, the image coding apparatus that employs the inter prediction uses, as a reference picture, a coded picture located before or after the current picture to be coded in display order. Subsequently, the image coding apparatus estimates a motion vector of the current picture with respect to the reference picture.
Next, the image coding apparatus obtains predicted image data resulting from motion compensation based on the motion vector. Then, the image coding apparatus obtains a difference between image data of the current picture and the predicted image data. Then, the image coding apparatus codes the obtained difference. Accordingly, the image coding apparatus removes the redundancy in the temporal direction.
The image coding apparatus in accordance with the moving picture coding scheme called H.264 (see Non-patent reference “ITU-T H.264 03/2010”) which has already been standardized uses three types of pictures, that is, I-picture, P-picture, and B-picture to compress the information amount. The image coding apparatus does not perform inter prediction on the I-picture. In other words, the image coding apparatus performs intra prediction on the I-picture. The intra prediction is also called intra-picture prediction.
Furthermore, the image coding apparatus performs inter prediction on the P-picture with reference to one coded picture located before or after the current picture in display order. Furthermore, the image coding apparatus performs inter prediction on the B-picture with reference to two coded pictures located before or after the current picture in display order.
In the inter prediction, the image coding apparatus generates a reference list (also called a reference picture list) for identifying a reference picture. In the reference list, reference picture indexes are allocated to coded reference pictures to be referred to in the inter prediction. For example, the image coding apparatus holds two reference lists (L0, L1) to refer to two pictures for the B-picture.
FIG. 33 illustrates an example of reference lists. The first reference picture list (L0) of FIG. 33 is an example of a reference picture list corresponding to a first prediction direction for the bi-directional prediction. In the first reference picture list of FIG. 33, a reference picture index indicated by 0 is allocated to a reference picture R1 in a display order 2. Furthermore, a reference picture index indicated by 1 is allocated to a reference picture R2 in a display order 1. Furthermore, a reference picture index indicated by 2 is allocated to a reference picture R3 in a display order 0.
In other words, in the first reference picture list of FIG. 33, a smaller reference picture index is allocated to a reference picture as the reference picture is closer to the current picture in display order.
On the other hand, the second reference picture list (L1) of FIG. 33 is an example of a reference picture list corresponding to a second prediction direction for the bi-directional prediction. In the second reference picture list of FIG. 33, a reference picture index indicated by 0 is allocated to the reference picture R2 in the display order 1. Furthermore, a reference picture index indicated by 1 is allocated to the reference picture R1 in the display order 2. Furthermore, a reference picture index indicated by 2 is allocated to the reference picture R3 in the display order 0.
As such, there are cases where two different reference picture indexes are allocated to a particular reference picture (reference picture R1 or R2 in FIG. 33) included in the two reference picture lists. Furthermore, there are cases where the same reference picture index is allocated to a particular reference picture (reference picture R3 in FIG. 33) included in the two reference picture lists.
The prediction using only the first reference picture list (L0) is called the L0 prediction. The prediction using only the second reference picture list (L1) is called the L1 prediction. The prediction using both of the first reference picture list and the second reference picture list is called the bi-directional prediction or bi-prediction.
In the L0 prediction, a forward direction is frequently used as a prediction direction. In the L1 prediction, a backward direction is frequently used as a prediction direction. In other words, the first reference picture list corresponds to the first prediction direction, and the second reference picture list corresponds to the second prediction direction.
Based on these relationships, the prediction direction is categorized into one of the first prediction direction, the second prediction direction, and the bi-direction. Furthermore, when the prediction direction is the bi-direction, it may be also represented as the bi-directional prediction or bi-prediction.
The H.264 image coding scheme has a motion vector estimation mode as a coding mode for the block to be coded in the B-picture. In the motion vector estimation mode, the image coding apparatus estimates a motion vector for a block to be coded with reference to a reference picture. The image coding apparatus generates predicted image data using the reference picture and the motion vector. Then, the image coding apparatus codes (i) a difference between the predicted image data and image data of the block to be coded and (ii) the motion vector to be used for generating the predicted image data.
The motion vector estimation mode may use the bi-directional prediction for generating a predicted image with reference to two coded pictures located before or after the current picture. Furthermore, the motion vector estimation mode may use the one-directional prediction for generating a predicted image with reference to one coded picture located before or after the current picture. Then, one of the bi-directional prediction and one-directional prediction is selected for a block to be coded.
When coding a motion vector in the motion vector estimation mode, the image coding apparatus generates a predicted motion vector from a motion vector of a block, such as an adjacent coded block to the current block. The image coding apparatus codes a difference between the motion vector and the predicted motion vector. Accordingly, the image coding apparatus reduces the information amount. The specific example will be described with reference to FIG. 34.
FIG. 34 illustrates a current block to be coded, an adjacent block A, an adjacent block B, and an adjacent block C. The adjacent block A is an adjacent coded block to the left of the current block. The adjacent block B is an adjacent coded block above the current block. The adjacent block C is an adjacent coded block to the upper right of the current block.
In FIG. 34, the adjacent block A has been coded with the bi-directional prediction, and has a motion vector MvL0_A in the first prediction direction, and a motion vector MvL1_A in the second prediction direction. Here, the motion vector in the first prediction direction is a motion vector indicating a position in a reference picture identified by the first reference picture list. The motion vector in the second prediction direction is a motion vector indicating a position in a reference picture identified by the second reference picture list.
Furthermore, the adjacent block B has been coded with the one-directional prediction, and has a motion vector MvL0_B in the first prediction direction. Furthermore, the adjacent block C has been coded with the bi-directional prediction, and has a motion vector MvL0_C in the first prediction direction, and a motion vector MvL1_C in the second prediction direction. Furthermore, the current block is a block to be coded with the bi-directional prediction, and has a motion vector MvL0 in the first prediction direction, and a motion vector MvL1 in the second prediction direction.
The image coding apparatus generates a predicted motion vector PMvL0 corresponding to the first prediction direction, using an adjacent block having a motion vector in the first prediction direction, when coding the motion vector MvL0 in the first prediction direction of the current block. More specifically, the image coding apparatus generates the predicted motion vector PMvL0 using the motion vector MvL0_A of the adjacent block A, the motion vector MvL0_B of the adjacent block B, and the motion vector MvL0_C of the adjacent block C.
In other words, the image coding apparatus uses a motion vector in the first prediction direction of an adjacent block to the current block, when coding the motion vector MvL0 in the first prediction direction of the current block. Then, the image coding apparatus codes a difference between the motion vector MvL0 and the predicted motion vector PMvL0.
The predicted motion vector PMvL0 is calculated using Median (MvL0_A, MvL0_B, and MvL0_C) that is an equation for calculating a median value (central value) of the motion vectors MvL0_A, MvL0_B, and MvL0_C. Median is represented by the following Equations 1 to 3.
                                              ⁢                  [                      Math            ⁢                                                  ⁢            1                    ]                                                                              Median          ⁡                      (                          x              ,              y              ,              z                        )                          =                  x          +          y          +          z          -                      Min            ⁡                          (                              x                ,                                  Min                  ⁡                                      (                                          y                      ,                      z                                        )                                                              )                                -                      Max            ⁡                          (                              x                ,                                  Max                  ⁡                                      (                                          y                      ,                      z                                        )                                                              )                                                          (                  Equation          ⁢                                          ⁢          1                )                                                          ⁢                  [                      Math            ⁢                                                  ⁢            2                    ]                                                                                              ⁢                              Min            ⁡                          (                              x                ,                y                            )                                =                      {                                                            x                                                                      (                                          x                      ≤                      y                                        )                                                                                                y                                                                      (                                          x                      >                      y                                        )                                                                                                          (                  Equation          ⁢                                          ⁢          2                )                                                          ⁢                  [                      Math            ⁢                                                  ⁢            3                    ]                                                                                              ⁢                              Max            ⁡                          (                              x                ,                y                            )                                =                      {                                                            x                                                                      (                                          x                      ≥                      y                                        )                                                                                                y                                                                      (                                          x                      <                      y                                        )                                                                                                          (                  Equation          ⁢                                          ⁢          3                )            
The image coding apparatus generates a predicted motion vector PMvL1 corresponding to the second prediction direction, using an adjacent block having a motion vector in the second prediction direction, when coding the motion vector MvL1 in the second prediction direction for the current block. More specifically, the image coding apparatus generates the predicted motion vector PMvL1 using the motion vector MvL1_A of the adjacent block A and the motion vector MvL1_C of the adjacent block C.
In other words, the image coding apparatus uses a motion vector in the second prediction direction of an adjacent block to the current block, when coding the motion vector MvL1 in the second prediction direction of the current block. Then, the image coding apparatus codes a differential motion vector that is a difference between the motion vector MvL1 and the predicted motion vector PMvL1. The predicted motion vector PMvL1 is calculated using Median (MvL1_A, 0, and MvL1_C) and others.